<?php
/**
 * handler - handler class name that is handling your annotation. handlers starting with __ are reserved.
 * syntax - regular expression that must match and parse your annotation.
 */
$DOMAR_ANNOTATIONS = array(
	
	'CLASS' => array(
		
		// @orm tableName _ARG_
		array(
			'handler' => '__tablename',
			'syntax' => '/@(?<tag>orm)( )*(?<type>(tableName|tablename))( )*(?<tableName>(\w+))( )*(\r\n|\n){1}/i',
		),
		
		// @orm database _ARG_
		array(
			'handler' => '__database',
			'syntax' => '/@(?<tag>orm)( )*(?<type>database)( )*(?<database>(\w+))( )*(\r\n|\n){1}/',
		),
		// @orm engine InnoDB|MyIsam
		array(
			'handler' => '__engine',
			'syntax' => '/@(?<tag>orm)( )*(?<type>engine)( )*(?<engine>(InnoDB|MyIsam))( )*(\r\n|\n){1}/',
		),
		// @orm index(args)|unique(args)
		array(
			'handler' => '__index',
			'syntax' => '/@(?<tag>orm)( )*(?<type>(index|unique|fulltext))\((?<fields_f>(.*))\)( )*(\r\n|\n){1}/',
		),
		//@orm listener $type $method()
		array(
			'handler' => '__listener',
			'syntax' => '/@(?<tag>orm)( )*(?<type>listener)( )*(?<listener>(\w+))( )*(?<method>(\w+))(\((?<args_f>(.*))\))?( )*(\r\n|\n){1}/',
		),
	),
	
	'PROPERTY' => array(
		
		//@orm listener $type [method] $method()
		array(
			'handler' => '__listener',
			'syntax' => '/@(?<tag>orm)( )*(?<type>listener)( )*(?<listener>(\w+))( )*(?<method>(\w+))(\((?<args_f>(.*))\))?( )*(\r\n|\n){1}/',
		),
		//@orm validator [method] $validator()
		array(
			'handler' => '__validator',
			'syntax' => '/@(?<tag>orm)( )*(?<type>validator)( )*(?<isMethod>method)?( )*(?<validator>([<>=\w]+))(\((?<args_f>(.*))\))?( )*(\r\n|\n){1}/',
		),
		//@orm plugin $plugin()
		array(
			'handler' => 'DomArClassParserRecordProperty_Plugin',
			'syntax' => '/@(?<tag>orm)( )*(?<type>plugin)( )*(?<plugin>(\w+))(\((?<args_f>(.*))\))?( )*(\r\n|\n){1}/',
		),
		//@orm has|owns many|children|parents $className [inverse $inverse] [itemValidator $itemValidator()] [counter $counter]
		array(
			'handler' => 'DomArClassParserRecordProperty_Relation',
			'syntax' => '/@(?<tag>orm)( )*(?<type>(has|owns))( )*(?<multiplicity>(one|parent|child|many|parents|children))( )*(?<className>(\w+))( inverse (?<inverse>(\w+)))?( (?<itemValidator>(\w+))(\((?<itemValidatorArgs_f>(.*))\))?)?( counter (?<counter>(\w+)))?( )*( relationTable (?<relationTableName>(\w+)))?( )*(\r\n|\n){1}/',
		),
		//@orm has|owns history $className inverse $inverse
		array(
			'handler' => 'DomArClassParserRecordProperty_History',
			'syntax' => '/@(?<tag>orm)( )*(?<type>(has|owns))( )*(?<history>(history))( )*(?<className>(\w+))( inverse (?<inverse>(\w+)))( )*(\r\n|\n){1}/',
		),
		//@orm order property_name
		array(
			'handler' => 'DomArClassParserRecordProperty_Order',
			'syntax' => '/@(?<tag>orm)( )*(?<type>order)( )*(?<property>(\w+))( )*(\r\n|\n){1}/',
		),
		//'@orm image [relative $relative] [tmp $tmp] [root $root] [url $url] [width $width] [height $height] [cut center]',
		//'@orm file [relative $relative] [tmp $tmp] [root $root] [url $url] ',
		
		//@orm datetime|date [not null] [index|unique] [default_value]
		array(
			'handler' => 'DomArClassParserRecordProperty_Datetime',
			'syntax' => '/@(?<tag>orm)( )*(?<type>(datetime|date))( )*(?<notNull>(not null)?)( )*(?<index>(index)?)( )*(?<defaultValue>(\w+)?)( )*(\r\n|\n){1}/',
		),
		//@orm text|longtext [not null]
		array(
			'handler' => 'DomArClassParserRecordProperty_Field',
			'syntax' => '/@(?<tag>orm)( )*(?<type>(text|longtext))( )*(?<notNull>(not null|not empty)?)( )*(?<index>(fulltext)?)( )*(\r\n|\n){1}/',
		),
		//@orm bool|boolean [not null] [unique|index]
		array(
			'handler' => 'DomArClassParserRecordProperty_Field',
			'syntax' => '/@(?<tag>orm)( )*(?<type>(bool|boolean))( )*(?<notNull>(not null)?)( )*(?<index>(unique|index)?)( )*(\r\n|\n){1}/',
		),
		//@orm enum($values) [index]
		array(
			'handler' => 'DomArClassParserRecordProperty_Field',
			'syntax' => '/@(?<tag>orm)( )*(?<type>(enum|set))\((?<length_f>(\S+))\)( )*(?<index>(index)?)( )*(\r\n|\n){1}/',
		),
		//@orm char($l) [not null] [unique|index|fulltext]
		array(
			'handler' => 'DomArClassParserRecordProperty_Field',
			'syntax' => '/@(?<tag>orm)( )*(?<type>(char))\((?<length_f>(\S+))\)( )*(?<notNull>(not null|not empty)?)( )*(?<index>(unique|index|fulltext)?)( )*(\r\n|\n){1}/',
		),
		//@orm int($l)|float($l,$m) [not null] [unique|index]
		array(
			'handler' => 'DomArClassParserRecordProperty_Field',
			'syntax' => '/@(?<tag>orm)( )*(?<type>(int|float))\((?<length_f>(\S+))\)( )*(?<notNull>(not null)?)( )*(?<index>(unique|index)?)( )*(\r\n|\n){1}/',
		),
		// @orm number($l,$d) [in()] [unique|index] [unsigned] [not null]
		array(
			'handler' => 'DomArClassParserRecordProperty_Number',
			'syntax' => '/@(?<tag>orm)( )*(?<type>(number))\((?<length_f>(\S+))\)( )*((?<in>(in))\((?<inArgs_f>(\S+))\))?( )*(?<unsigned>(unsigned)?)( )*(?<index>(unique|index)?)( )*(?<notNull>(not null)?)( )*(\r\n|\n){1}/',
		),
		//@orm array
		array(
			'handler' => 'DomArClassParserRecordProperty_Field',
			'syntax' => '/@(?<tag>orm)( )*(?<type>(array))( )*(\r\n|\n){1}/',
		),
		//@orm email [unique|index]
		array(
			'handler' => 'DomArClassParserRecordProperty_Field',
			'syntax' => '/@(?<tag>orm)( )*(?<type>(email))( )*(?<notNull>(not null|not empty)?)( )*(?<index>(unique|index)?)( )*(\r\n|\n){1}/',
		),
		//@orm password($l,$m)
		array(
			'handler' => 'DomArClassParserRecordProperty_Field',
			'syntax' => '/@(?<tag>orm)( )*(?<type>password)\((?<length_f>(\S+))\)( )*(?<notNull>(not null|not empty)?)( )*(\r\n|\n){1}/',
		),
	
	
	
		//@orm slug(fields)
		array(
			'handler' => 'DomArClassParserRecordProperty_Slug',
			'syntax' => '/@(?<tag>orm)( )*(?<type>(slug))\((?<fields_f>(\S+))\)( )*(\r\n|\n){1}/',
		),
		//@orm searchIndex(fields)
		array(
			'handler' => 'DomArClassParserRecordProperty_SearchIndex',
			'syntax' => '/@(?<tag>orm)( )*(?<type>(searchIndex))\((?<fields_f>(\S+))\)( )*(\r\n|\n){1}/',
		),
		
	),
	
	'METHOD' => array(
		
		// @orm access
		array(
			'handler' => '__access',
			'syntax' => '/@(?<tag>orm)( )*(?<type>access)( record)?( )*(\r\n|\n){1}/',
		),
	),
	
	'ALL' => array(
		
	),
);

?>